<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>Python第三方库numpy的简单入门使用 | 小豆子的Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="首先，我们需要导入包文件 1import numpy as np  一、numpy中的一般语法123456789101112# 矩阵的逆、转置及秩data_1 &#x3D; np.matrix(&#39;3 4 5;7 8 9&#39;)print(data_1)print(&quot;矩阵的逆:&quot;)data_2 &#x3D; data_1.Iprint(data_2)print(&quot;矩阵的转置:&quot;)data_3 &#x3D; data_1.Tprint">
<meta property="og:type" content="article">
<meta property="og:title" content="Python第三方库numpy的简单入门使用">
<meta property="og:url" content="http://yoursite.com/2020/06/07/Python%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93numpy%E7%9A%84%E7%AE%80%E5%8D%95%E5%85%A5%E9%97%A8%E4%BD%BF%E7%94%A8/index.html">
<meta property="og:site_name" content="小豆子的Blog">
<meta property="og:description" content="首先，我们需要导入包文件 1import numpy as np  一、numpy中的一般语法123456789101112# 矩阵的逆、转置及秩data_1 &#x3D; np.matrix(&#39;3 4 5;7 8 9&#39;)print(data_1)print(&quot;矩阵的逆:&quot;)data_2 &#x3D; data_1.Iprint(data_2)print(&quot;矩阵的转置:&quot;)data_3 &#x3D; data_1.Tprint">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-07T07:08:45.000Z">
<meta property="article:modified_time" content="2020-06-07T07:09:15.434Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="小豆子的Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">小豆子的Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-Python第三方库numpy的简单入门使用" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2020/06/07/Python%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93numpy%E7%9A%84%E7%AE%80%E5%8D%95%E5%85%A5%E9%97%A8%E4%BD%BF%E7%94%A8/" class="article-date">
  <time datetime="2020-06-07T07:08:45.000Z" itemprop="datePublished">2020-06-07</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      Python第三方库numpy的简单入门使用
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>首先，我们需要导入包文件</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br></pre></td></tr></table></figure>

<h2 id="一、numpy中的一般语法"><a href="#一、numpy中的一般语法" class="headerlink" title="一、numpy中的一般语法"></a>一、numpy中的一般语法</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 矩阵的逆、转置及秩</span></span><br><span class="line">data_1 = np.matrix(<span class="string">'3 4 5;7 8 9'</span>)</span><br><span class="line">print(data_1)</span><br><span class="line">print(<span class="string">"矩阵的逆:"</span>)</span><br><span class="line">data_2 = data_1.I</span><br><span class="line">print(data_2)</span><br><span class="line">print(<span class="string">"矩阵的转置:"</span>)</span><br><span class="line">data_3 = data_1.T</span><br><span class="line">print(data_3)</span><br><span class="line">print(<span class="string">"矩阵的秩:"</span>)</span><br><span class="line">data_4 = np.linalg.matrix_rank(data_1)</span><br><span class="line">print(data_4)</span><br></pre></td></tr></table></figure>

<pre><code>[[3 4 5]
 [7 8 9]]
矩阵的逆:
[[-1.08333333  0.58333333]
 [-0.08333333  0.08333333]
 [ 0.91666667 -0.41666667]]
矩阵的转置:
[[3 7]
 [4 8]
 [5 9]]
矩阵的秩:
2</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 矩阵的维度（也称为轴数）</span></span><br><span class="line">print(data_1.ndim)</span><br></pre></td></tr></table></figure>

<pre><code>2</code></pre><h2 id="二、数组的创建"><a href="#二、数组的创建" class="headerlink" title="二、数组的创建"></a>二、数组的创建</h2><ol>
<li>创建二维数组<br>  这里强调：使用matrix只能创建二维矩阵，而是用非matrix方法可以创建高维矩阵</li>
</ol>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 全0的矩阵</span></span><br><span class="line">arr_1 = np.matrix(np.zeros((<span class="number">3</span>, <span class="number">3</span>)))</span><br><span class="line">print(arr_1)</span><br><span class="line"><span class="comment"># 或者</span></span><br><span class="line">arr_1 = np.zeros((<span class="number">3</span>, <span class="number">3</span>))</span><br><span class="line">print(arr_1)</span><br></pre></td></tr></table></figure>

<pre><code>[[0. 0. 0.]
 [0. 0. 0.]
 [0. 0. 0.]]
[[0. 0. 0.]
 [0. 0. 0.]
 [0. 0. 0.]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 全1的矩阵</span></span><br><span class="line">arr_2 = np.matrix(np.ones((<span class="number">3</span>, <span class="number">3</span>)))</span><br><span class="line">print(arr_2)</span><br><span class="line"><span class="comment"># 或者</span></span><br><span class="line">arr_2 = np.ones((<span class="number">3</span>, <span class="number">3</span>))</span><br><span class="line">print(arr_2)</span><br></pre></td></tr></table></figure>

<pre><code>[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]
[[1. 1. 1.]
 [1. 1. 1.]
 [1. 1. 1.]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 创建随机矩阵</span></span><br><span class="line">arr_3 = np.matrix(np.random.rand(<span class="number">3</span>, <span class="number">4</span>))</span><br><span class="line">arr_3</span><br></pre></td></tr></table></figure>




<pre><code>matrix([[0.48890396, 0.09218043, 0.38339213, 0.61843015],
        [0.35092127, 0.08485116, 0.84651857, 0.4481831 ],
        [0.88727766, 0.56471182, 0.49473952, 0.69027512]])</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 创建整数随机矩阵</span></span><br><span class="line">arr_4 = np.matrix(np.random.randint(<span class="number">5</span>, <span class="number">10</span>, size=(<span class="number">3</span>, <span class="number">4</span>)))</span><br><span class="line">arr_4</span><br></pre></td></tr></table></figure>




<pre><code>matrix([[7, 7, 7, 5],
        [6, 5, 8, 5],
        [5, 6, 7, 6]])</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 创建对角矩阵</span></span><br><span class="line">new_list = [i <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">3</span>, <span class="number">7</span>)]</span><br><span class="line">arr_5 = np.matrix(np.diag(new_list))</span><br><span class="line">arr_5</span><br></pre></td></tr></table></figure>




<pre><code>matrix([[3, 0, 0, 0],
        [0, 4, 0, 0],
        [0, 0, 5, 0],
        [0, 0, 0, 6]])</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 创建单位矩阵</span></span><br><span class="line">arr_6 = np.eye(<span class="number">3</span>)</span><br><span class="line">arr_6</span><br></pre></td></tr></table></figure>




<pre><code>array([[1., 0., 0.],
       [0., 1., 0.],
       [0., 0., 1.]])</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 改变矩阵的形状</span></span><br><span class="line">print(arr_4)</span><br><span class="line">arr_7 = arr_4.reshape(<span class="number">4</span>, <span class="number">3</span>)</span><br><span class="line">arr_7</span><br></pre></td></tr></table></figure>

<pre><code>[[7 7 7 5]
 [6 5 8 5]
 [5 6 7 6]]





matrix([[7, 7, 7],
        [5, 6, 5],
        [8, 5, 5],
        [6, 7, 6]])</code></pre><ol start="2">
<li>高维数组</li>
</ol>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 例如创建3维的数组</span></span><br><span class="line">arr_8 = np.arange(<span class="number">24</span>).reshape(<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>)</span><br><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"数组维度："</span>+str(arr_8.ndim))</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
数组维度：3</code></pre><h2 id="三、numpy的索引和切片"><a href="#三、numpy的索引和切片" class="headerlink" title="三、numpy的索引和切片"></a>三、numpy的索引和切片</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"单独获取到一个值"</span>)</span><br><span class="line">print(arr_8[<span class="number">0</span>,<span class="number">0</span>,<span class="number">3</span>])</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
单独获取到一个值
3</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"获取到深度为0的所有值"</span>)</span><br><span class="line">print(arr_8[<span class="number">0</span>,:,:])</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
获取到深度为0的所有值
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"获取到深度为0的前两行的值"</span>)</span><br><span class="line">print(arr_8[<span class="number">0</span>,:<span class="number">2</span>,:])</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
获取到深度为0的前两行的值
[[0 1 2 3]
 [4 5 6 7]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"获取到深度为0的前两行后两列的值"</span>)</span><br><span class="line">print(arr_8[<span class="number">0</span>,:<span class="number">2</span>,<span class="number">-2</span>:])</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
获取到深度为0的前两行后两列的值
[[2 3]
 [6 7]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">print(arr_8)</span><br><span class="line">print(<span class="string">"获取到深度为0的前两行后两列的值并替换为-2"</span>)</span><br><span class="line">print(<span class="string">"获取到深度为0的前两行后两列的值"</span>)</span><br><span class="line">print(arr_8[<span class="number">0</span>,:<span class="number">2</span>,<span class="number">-2</span>:])</span><br><span class="line">print(<span class="string">"替换为-2"</span>)</span><br><span class="line">arr_8[<span class="number">0</span>,:<span class="number">2</span>,<span class="number">-2</span>:] = <span class="number">-2</span></span><br><span class="line">print(<span class="string">"原来数组"</span>)</span><br><span class="line">print(arr_8)</span><br></pre></td></tr></table></figure>

<pre><code>[[[ 0  1  2  3]
  [ 4  5  6  7]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
获取到深度为0的前两行后两列的值并替换为-2
获取到深度为0的前两行后两列的值
[[2 3]
 [6 7]]
替换为-2
原来数组
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]</code></pre><h2 id="四、numpy的合并功能"><a href="#四、numpy的合并功能" class="headerlink" title="四、numpy的合并功能"></a>四、numpy的合并功能</h2><pre><code>1. 在第一轴合并
2. 在第二轴合并
3. 在第三轴合并
4. 在任意轴合并</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 1. 在第一轴合并</span></span><br><span class="line"><span class="comment"># vstack</span></span><br><span class="line">print(<span class="string">"合并前的arr_8\n"</span>+str(arr_8))</span><br><span class="line">temp_1 = arr_8</span><br><span class="line">temp_2 = arr_8</span><br><span class="line">temp = np.vstack((temp_1, temp_2))</span><br><span class="line">print(<span class="string">"两个arr_8合并后\n"</span>+str(temp))</span><br></pre></td></tr></table></figure>

<pre><code>合并前的arr_8
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
两个arr_8合并后
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]

 [[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 2. 在第二轴合并</span></span><br><span class="line"><span class="comment"># hstack</span></span><br><span class="line">print(<span class="string">"合并前的arr_8\n"</span>+str(arr_8))</span><br><span class="line">temp_1 = arr_8</span><br><span class="line">temp_2 = arr_8</span><br><span class="line">temp = np.hstack((temp_1, temp_2))</span><br><span class="line">print(<span class="string">"两个arr_8合并后\n"</span>+str(temp))</span><br></pre></td></tr></table></figure>

<pre><code>合并前的arr_8
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
两个arr_8合并后
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]
  [ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]
  [12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 3. 在第三轴合并</span></span><br><span class="line"><span class="comment"># dstack</span></span><br><span class="line">print(<span class="string">"合并前的arr_8\n"</span>+str(arr_8))</span><br><span class="line">temp_1 = arr_8</span><br><span class="line">temp_2 = arr_8</span><br><span class="line">temp = np.dstack((temp_1, temp_2))</span><br><span class="line">print(<span class="string">"两个arr_8合并后\n"</span>+str(temp))</span><br></pre></td></tr></table></figure>

<pre><code>合并前的arr_8
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
两个arr_8合并后
[[[ 0  1 -2 -2  0  1 -2 -2]
  [ 4  5 -2 -2  4  5 -2 -2]
  [ 8  9 10 11  8  9 10 11]]

 [[12 13 14 15 12 13 14 15]
  [16 17 18 19 16 17 18 19]
  [20 21 22 23 20 21 22 23]]]</code></pre><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 4. 任意轴合并</span></span><br><span class="line"><span class="comment"># concatenate</span></span><br><span class="line">print(<span class="string">"合并前的arr_8\n"</span>+str(arr_8))</span><br><span class="line">temp_1 = arr_8</span><br><span class="line">temp_2 = arr_8</span><br><span class="line"><span class="comment"># axis表示设置在何处轴合并，默认在第一轴</span></span><br><span class="line">temp = np.concatenate((arr_8, arr_8), axis=<span class="number">2</span>)</span><br><span class="line">print(<span class="string">"两个arr_8合并后\n"</span>+str(temp))</span><br></pre></td></tr></table></figure>

<pre><code>合并前的arr_8
[[[ 0  1 -2 -2]
  [ 4  5 -2 -2]
  [ 8  9 10 11]]

 [[12 13 14 15]
  [16 17 18 19]
  [20 21 22 23]]]
两个arr_8合并后
[[[ 0  1 -2 -2  0  1 -2 -2]
  [ 4  5 -2 -2  4  5 -2 -2]
  [ 8  9 10 11  8  9 10 11]]

 [[12 13 14 15 12 13 14 15]
  [16 17 18 19 16 17 18 19]
  [20 21 22 23 20 21 22 23]]]</code></pre>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2020/06/07/Python%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93numpy%E7%9A%84%E7%AE%80%E5%8D%95%E5%85%A5%E9%97%A8%E4%BD%BF%E7%94%A8/" data-id="ckb4q7iel00005cbigcmm0ib7" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
  
    <a href="/2020/06/02/Python%E8%BF%AD%E4%BB%A3%E5%99%A8%E5%8F%8A%E7%94%9F%E6%88%90%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Python迭代器及生成器的简单理解</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">六月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">五月 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/06/07/Python%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93numpy%E7%9A%84%E7%AE%80%E5%8D%95%E5%85%A5%E9%97%A8%E4%BD%BF%E7%94%A8/">Python第三方库numpy的简单入门使用</a>
          </li>
        
          <li>
            <a href="/2020/06/02/Python%E8%BF%AD%E4%BB%A3%E5%99%A8%E5%8F%8A%E7%94%9F%E6%88%90%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3/">Python迭代器及生成器的简单理解</a>
          </li>
        
          <li>
            <a href="/2020/06/01/Python%E8%A3%85%E9%A5%B0%E5%99%A8%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3/">Python装饰器的简单理解</a>
          </li>
        
          <li>
            <a href="/2020/06/01/Python%E9%97%AD%E5%8C%85%E7%9A%84%E7%AE%80%E8%A6%81%E4%BB%8B%E7%BB%8D/">闭包的简要介绍</a>
          </li>
        
          <li>
            <a href="/2020/05/31/Python%E8%BF%9E%E6%8E%A5C%E5%AE%9E%E7%8E%B0%E9%AB%98%E6%95%88%E7%BC%96%E7%A8%8Bdemo/">Python连接C实现高效编程demo</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
</body>
</html>